Take a look at the code of this template to see an example with comments.
{# Prepare our error macro #}
{% macro errorList(errors) %}
{# To display errors, you want to make sure errors exist,
and then you can loop through and display them #}
{% if errors %}